package lab3;

public class Restart {
	static class R_Athread extends Thread{
		public void run(){
			System.out.println("   Thread starting ...");
			for (int i=10; i>-1; i--)
				System.out.println("     " + i);
			System.out.println("   ... thread done!");
		}
	}
	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		System.out.println("Program starting ...");
		R_Athread t = new R_Athread();
		t.start();
		// wait for t to be done:
		t.join();

		/*
		 * Now try to run the thread again.
		 */
		t.start();
		// wait for t to be done:
		t.join();
		System.out.println("... program done!");
	}

}
